#!/usr/bin/env python

"""Custom errors such as notfound and internal errors.
"""

__author__ = 'Yong Liu'
__version__ = '0.1'
__date__ = '2010-07-06'

import web

from app.controllers.i18n import switch_language
from config import slogan

def notfound():
    pages = switch_language()
    return web.notfound(pages.notfound(slogan))

def internalerror():
    pages = switch_language()
    return web.internalerror(pages.internalerror(slogan))

def add(app):
    app.notfound = notfound
    app.internalerror = internalerror
    
